<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ContractRent extends Model
{
    use HasFactory;

    public $table = 'contract_rent';

    public $guarded = [];

    public $appends = ['rent_num_name'];

    public function getRentNumNameAttribute()
    {
        switch ($this->rent_num) {
            case 1:
                return '月付';
            case 3:
                return '季付';
            case 6:
                return '半年付';
        }
        return '-';
    }
}
